Avoid a redundant strlen
authorMatthias Clasen <mclasen@redhat.com>
Sat, 28 Jun 2014 05:51:24 +0000 (01:51 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 28 Jun 2014 05:51:24 +0000 (01:51 -0400)
The GString knows perfectly well how long it is.  Pointed out in
https://bugzilla.gnome.org/show_bug.cgi?id=731158

gtk/gtkbookmarksmanager.c

index 197c4cee8a03c547eb7c54c41651d1b6bb90c325..968b49c525cd58845b935279acc1053d1ed5e85f 100644 (file)
@@ -160,7 +160,7 @@ save_bookmarks (GFile  *bookmarks_file,
     }
   if (!g_file_replace_contents (bookmarks_file,
                                contents->str,
-                               strlen (contents->str),
+                               contents->len,
                                NULL, FALSE, 0, NULL,
                                NULL, &error))
     goto out;